package com.taotao.controller;

import com.taotao.pojo.PictureResult;
import com.taotao.service.PictureService;
import com.taotao.utils.JsonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created by 李小磊 on 2017/3/14.
 */
@Controller
public class PictureController {
    @Autowired
    private PictureService pictureService;


    //查询商品返回结果
    @RequestMapping("/pic/upload")
    @ResponseBody
    public String getItemList(MultipartFile uploadFile)  {
        PictureResult pictureResult = pictureService.upLoadPic(uploadFile);
        String objectToJson = JsonUtils.objectToJson(pictureResult);
        return objectToJson ;
    }
}
